Revert SCR-68: roll back Hyperline migration, restore Stripe billing#21
Merged
Conversation
This reverts commit 3a94103.
The SCR-68 Hyperline migration explicitly DROPPED stripe_customer_id from accounts. The reverted init.sql only had idempotent ADD COLUMNs for the other dropped columns (stripe_default_payment_method_id, auto_topup_*), not for stripe_customer_id itself — so production deploy would 500 on the first /account/billing request because stripe.rs heavily queries this column. Adds an IF NOT EXISTS block so the next API boot self-heals the schema.
NEXT_PUBLIC_* vars are inlined by Next.js at build time, so this needs to be a Dockerfile ENV (not a Fly runtime secret). Publishable keys are public by design — safe to commit, they appear in every browser bundle anyway.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Reverts the SCR-68 Stripe→Hyperline migration. Restores the pre-migration Stripe billing implementation in full (`bins/scrapix-api/src/stripe.rs` + the original console billing page with Stripe Elements).
Reverted commits (in reverse merge order):
Plus one fix on top: `ca08a02` re-adds an idempotent `ALTER TABLE accounts ADD COLUMN IF NOT EXISTS stripe_customer_id` to `deploy/postgres/init.sql`. SCR-68 explicitly dropped this column; the revert restored the inline `CREATE TABLE` definition but *not* an idempotent migration to re-add it on existing DBs. Without this, the first `/account/billing` request would 500 because `stripe.rs` heavily queries the column.
Why revert
The Hyperline integration didn't fit. Going back to Stripe is the path of least surprise — the code on this branch was working in production before SCR-68 was merged.
User confirmed: zero paying customers at time of revert, so the destructive rollback is data-safe.
Schema state after deploy
The reverted `init.sql` runs on every API boot via `sqlx::raw_sql(...)`. After this PR deploys:
Deploy plan
Follow-up cleanup PR (not in this one)
Verification
Test plan